package org.sd.netty;

import org.springframework.mock.web.MockServletContext;

/**
 * 重写读取静态文件的方法
 */
public class CustomMockServletContext extends MockServletContext {

    /**
     * {@inheritDoc}
     * @param path
     * @return
     */
    @Override
    protected String getResourceLocation(String path) {
        String resourceLocation = super.getResourceLocation(path);

        if (resourceLocation.startsWith("/")) {
            return resourceLocation.replaceFirst("/", "");
        }
        return resourceLocation;
    }
}
